import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '帐户名称',
    align:"center",
    sorter: true,
    dataIndex: 'name'
   },
   {
    title: '开户银行',
    align:"center",
    sorter: true,
    dataIndex: 'accountBank'
   },
   {
    title: '账户账号',
    align:"center",
    dataIndex: 'accountNo'
   },
   {
    title: '账户性质',
    align:"center",
    dataIndex: 'accountType'
   },
   {
    title: '开户日期',
    align:"center",
    dataIndex: 'openDate'
   },
   {
    title: '开户依据',
    align:"center",
    dataIndex: 'accountCredit'
   },
   {
    title: '核算内容',
    align:"center",
    dataIndex: 'accountContent'
   },
   {
    title: '资金来源',
    align:"center",
    dataIndex: 'fundsProvid'
   },
   {
    title: '清理意见',
    align:"center",
    dataIndex: 'note'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remarks'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "帐户名称",
      field: 'name',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "开户银行",
      field: 'accountBank',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "账户账号",
      field: 'accountNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '帐户名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '开户银行',
    field: 'accountBank',
    component: 'Input',
  },
  {
    label: '账户账号',
    field: 'accountNo',
    component: 'Input',
  },
  {
    label: '账户性质',
    field: 'accountType',
    component: 'Input',
  },
  {
    label: '开户日期',
    field: 'openDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '开户依据',
    field: 'accountCredit',
    component: 'Input',
  },
  {
    label: '核算内容',
    field: 'accountContent',
    component: 'Input',
  },
  {
    label: '资金来源',
    field: 'fundsProvid',
    component: 'Input',
  },
  {
    label: '清理意见',
    field: 'note',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remarks',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '帐户名称',order: 0,view: 'text', type: 'string',},
  accountBank: {title: '开户银行',order: 1,view: 'text', type: 'string',},
  accountNo: {title: '账户账号',order: 2,view: 'text', type: 'string',},
  accountType: {title: '账户性质',order: 3,view: 'text', type: 'string',},
  openDate: {title: '开户日期',order: 4,view: 'datetime', type: 'string',},
  accountCredit: {title: '开户依据',order: 5,view: 'text', type: 'string',},
  accountContent: {title: '核算内容',order: 6,view: 'text', type: 'string',},
  fundsProvid: {title: '资金来源',order: 7,view: 'text', type: 'string',},
  note: {title: '清理意见',order: 8,view: 'text', type: 'string',},
  remarks: {title: '备注',order: 9,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}